<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/home/include/init_home.jsp" %>
<%
	if (session_email_addr.equals("")) {
		response.sendRedirect("./login.jsp?pmenu_id="+pmenu_id+"&menu_id="+menu_id);
	}

	String curr_page		= StringUtil.nvl(request.getParameter("curr_page"),"1");

	HashMap infos = new HashMap();
	infos.put("session_email_addr",		session_email_addr);
	infos.put("session_password",		session_password);
	infos.put("curr_page", 		curr_page);


	HomeDAO dao 		= new HomeDAO();
	HashList list 		= dao.selectReqList(infos);
	HashList estList 	= dao.selectEstList(infos);		//견적서 목록
	HashList confList 	= dao.selectConfirmList(infos);		//예약확인서,바우처,안내문 목록

	int totalCount		= dao.selectReqCount(infos);

	BoardDAO boardDAO	= new BoardDAO();
	int totalPage		= boardDAO.getTotalPage(totalCount);


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%= HOME_NAME %></title>
<link href="../css/home.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="/js/common2.js" charset="utf-8"></script>
<script>
	function fnConfirmDetail(gubn, est_no, est_seq)
	{
		if (gubn == 'master') {
			cfOpen('/home/voucher/masterVoucher.jsp?est_no='+est_no+'&est_seq='+est_seq, '조인하와이', 900, 600);
		}
		else if (gubn == 'hotel') {
			cfOpen('/home/voucher/hotelVoucher.jsp?est_no='+est_no+'&est_seq='+est_seq, '조인하와이', 900, 600);
		}
		else if (gubn == 'car') {
			cfOpen('/home/voucher/carVoucher.jsp?est_no='+est_no+'&est_seq='+est_seq, '조인하와이', 900, 600);
		}
		else if (gubn == 'fly') {
			cfOpen('/home/voucher/flyVoucher.jsp?est_no='+est_no+'&est_seq='+est_seq, '조인하와이', 900, 600);
		}
		else if (gubn == 'enjoy') {
			cfOpen('/home/voucher/enjoyVoucher.jsp?est_no='+est_no+'&est_seq='+est_seq, '조인하와이', 900, 600);
		}
	}
</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <%@ include file="/home/include/top_menu.jsp" %>
  <tr>
    <td valign="top" align="center" class="sub_con"><table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
      <!-- 좌측 네비 시작-->
        <%@ include file="/home/include/left_menu.jsp" %>
        <!-- 좌측 네비 끝-->
        <td width="50"></td>
        <!-- 컨텐츠 시작-->
        <td valign="top" align="left"><table width="723" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="66%"><img src="../images/sub/09_title_01.gif" alt="고객센터"  /><img src="../images/sub/09_title_sub.gif" /></td>
                <td width="34%" align="right" valign="bottom"></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="5"><img src="../images/sub/sub_line.gif" width="723" height="5" /></td>
          </tr>
          <tr>
            <td height="30"></td>
          </tr>
          <tr>
            <td class="sub_title"><%= menu_name %></td>
          </tr>
          <tr>
                <td height="30"></td>
          </tr>
          <!--입력폼 시작-->
          <tr>
            <td height="30">

              <table width="100%" border="0" cellspacing="0" cellpadding="0">



              <!--견적의뢰 및 바로예약 시작-->
              <tr>
                <td height="34"><img src="../images/sub/customer_02_t_004.gif" alt="견적내용" width="96" height="26" /></td>
              </tr>
              <tr>
                <td height="2" bgcolor="#999999"></td>
              </tr>
              <tr>
                <td valign="top">
                	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		              <tr height="32">
		                <th align="center">구분</th>
		                <th width="90" align="center">출발일</th>
		                <th width="200" align="center">여행일정</th>
		                <th width="100" align="center">1인예상금액</th>
		                <th width="100" align="center">견적일</th>
		                <th width="100" align="center">처리결과</th>
		              </tr>
		              <tr>
		                <td colspan="6" height="1" bgcolor="#cccccc"></td>
		              </tr>
       <%

         for (int i = 0; i < list.size(); i++) {

       %>
                      <tr height="34">
                        <td align="center">
                    <%	if ("1".equals(list.get("req_gubn",i))) {	%>
                    		<a href="./reqUpdate.jsp?req_id=<%= list.get("req_id",i) %>&pmenu_id=<%=pmenu_id%>&menu_id=<%=menu_id%>"><%= list.get("req_gubn_name", i) %></a>
                    <%	} else if ("2".equals(list.get("req_gubn",i))) { %>
                    		<a href="./reservationUpdate.jsp?req_id=<%= list.get("req_id",i) %>&pmenu_id=<%=pmenu_id%>&menu_id=<%=menu_id%>"><%= list.get("req_gubn_name", i) %></a>
                    <%	} %>
						</td>
                        <td width="90" align="center" valign="middle">
                    <%	if ("1".equals(list.get("req_gubn",i))) {	%>
                    		<a href="./reqUpdate.jsp?req_id=<%= list.get("req_id",i) %>&pmenu_id=<%=pmenu_id%>&menu_id=<%=menu_id%>"><%= StringUtil.toDate(list.get("start_dt", i)) %></a>
                    <%	} else if ("2".equals(list.get("req_gubn",i))) { %>
                    		<a href="./reservationUpdate.jsp?req_id=<%= list.get("req_id",i) %>&pmenu_id=<%=pmenu_id%>&menu_id=<%=menu_id%>"><%= StringUtil.toDate(list.get("start_dt", i)) %></a>
                    <%	} %>
                        </td>
                        <td align="center"><%= list.get("travel_type_name",i) %></td>
                        <td align="center"><%= StringUtil.toPrice(list.get("est_amt",i)) %> 만원</td>
                        <td align="center"><%= StringUtil.toDate(list.get("req_dt",i)) %></td>
                        <td align="center">
                <%	if ("2".equals(list.get("req_status",i))) { %>
                			<img src="../images/main/realtime_complete.gif" alt="<%= list.get("req_status_name",i) %>"/>
               	<%	} else { %>
                        	<img src="../images/main/realtime_wait.gif" alt="<%= list.get("req_status_name",i) %>"/>
                <%	} %>
                        </td>
                      </tr>
                      <tr>
                        <td height="1" colspan="6" class="board_line"></td>
                      </tr>
   <%

         } %>

                </table></td>
                  </tr>
                  <tr>
                    <td class="customer_line_01"></td>
                  </tr>
                </table></td>
              </tr>
              <!--견적의뢰 및 바로예약 끝-->


			  <!-- 견적서 -->
			  <tr>
                <td height="36"></td>
              </tr>
              <tr>
                <td height="34"><img src="../images/sub/confirm_01_t_02.gif" alt="견적서"  height="26" /></td>
              </tr>
              <tr>
                <td height="2" bgcolor="#999999"></td>
              </tr>
              <tr>
                <td valign="top">
                	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		              <tr height="32">
		                <th width="100" align="center">견적번호</th>
		                <th align="center">제목</th>
		                <th width="100" align="center">출발일</th>
		                <th width="100" align="center">상태</th>
		                <th width="100" align="center">발행일</th>
		              </tr>
		              <tr>
		                <td colspan="5" height="1" bgcolor="#cccccc"></td>
		              </tr>
<%

         for (int i = 0; i < estList.size(); i++) {

       %>
                      <tr height="34">
                        <td align="center"><%= estList.get("est_no", i) %></td>
                        <td align="center">
							<a href="#nohref" onclick="fnConfirmDetail('<%= estList.get("gubn", i).trim() %>', '<%= estList.get("est_no", i) %>', '<%= estList.get("est_seq", i) %>')"><%= estList.get("title", i) %></a>
						</td>
                        <td align="center"><%= StringUtil.toDate(estList.get("travel_start_dt", i)) %></td>
                        <td align="center"><%= estList.get("est_state_name",i) %></td>
                        <td align="center"><%= StringUtil.toDate(estList.get("issue_dt",i)) %></td>
                      </tr>
                      <tr>
                        <td height="1" colspan="5" class="board_line"></td>
                      </tr>
   <%

         } %>

                </table></td>
                  </tr>
              <tr>
                <td class="customer_line_01"></td>
              </tr>



              <tr>
                <td height="36"></td>
              </tr>
              <!--예약확인서 시작-->
              <tr>
                <td height="34"><img src="../images/sub/confirm_01_t_03.gif" alt="예약확인서" width="96" height="26" /></td>
              </tr>
              <tr>
                <td height="2" bgcolor="#999999"></td>
              </tr>
              <tr>
                <td valign="top">
                	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		              <tr height="32">
		                <th width="100" align="center">예약번호</th>
		                <th align="center">제목</th>
		                <th width="100" align="center">발행자</th>
		                <th width="100" align="center">발행일</th>
		              </tr>
		              <tr>
		                <td colspan="5" height="1" bgcolor="#cccccc"></td>
		              </tr>
		<%
			String lastEstNo = "";
			String styleName = "";

         	for (int i = 0; i < confList.size(); i++) {
				if (i == 0) {
					lastEstNo = confList.get("est_no", i);
				}

				if (lastEstNo.equals(confList.get("est_no",i))) {
					styleName = "cur_est";
				} else {
					styleName = "pre_est";
				}
       %>
                      <tr height="34">
                        <td align="center" class="<%=styleName%>"><%= confList.get("est_no", i) %></td>
                        <td align="center" class="<%=styleName%>">
				<%	if ("guide".equals(confList.get("gubn",i))) { %>
						<a href="/common/file_download.jsp?file_path=<%= confList.get("est_seq", i) %>&file_name=<%= confList.get("title", i) %>" class="<%=styleName%>"><%= confList.get("title", i) %></a>
				<%	} else { %>
						<a href="#nohref" onclick="fnConfirmDetail('<%= confList.get("gubn", i).trim() %>', '<%= confList.get("est_no", i) %>', '<%= confList.get("est_seq", i) %>')" class="<%=styleName%>"><%= confList.get("title", i) %></a>
				<%	} %>
						</td>
                        <td align="center" class="<%=styleName%>"><%= confList.get("issue_user",i) %></td>
                        <td align="center" class="<%=styleName%>"><%= StringUtil.toDate(confList.get("issue_dt",i)) %></td>
                      </tr>
                      <tr class="<%=styleName%>">
                        <td height="1" colspan="6" class="board_line"></td>
                      </tr>
   <%

         } %>

                </table></td>
                  </tr>
                  <tr>
                    <td class="customer_line_01"></td>
                  </tr>
                  <tr height="100px">
				  	<td align="center"><a href="./logout.jsp"><img src="../images/sub/login_close.gif"/></a></td>
				  </tr>
                </table>
                </td>
              </tr>
              <!-- 예약확인서 끝-->





          <tr>
          	<td height="80"></td>
          </tr>
        </table></td>
        <!-- 컨텐츠 끝-->
  </tr>
  <%@ include file="/home/include/footer.jsp" %>
</table>
</body>
</html>
